<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");

if(!$_COOKIE['userid']){
	$arr = array('error'=>1,'msg'=>'添加成功！');
	echo json_encode($arr);
}
$sql="select * from tbl_taospp where id=".$_POST['goodsid'];
$a=mysql_query($sql);
$rowa=mysql_fetch_array($a);

$order_id = $_COOKIE['userid']."a".date('YmdHis',time());
$money = $rowa['zswprice'];
	
    //	插入订单表			 
    $sqlor = "insert into tbl_taorder values (0,
	'".$_COOKIE['userid']."',
	'".$rowa['id']."',
	'".$order_id."',
	'".$rowa['zswprice']."',
	'".$rowa['zswprice']."',	
	1,
	0,
	0,
	1,
	'".time()."',
	'".time()."',
	0,
	0,
	0,
	0,
	'".$money."',
	0,
	0,
	0,
	3,
	0,
	0,
	0,
	'".date('y-m-d h:i:s')."')";
   $res= mysql_query($sqlor);

  // echo  $sqlor;die;
	 if($res){
	$arr = array('error'=>0,'msg'=>'成功！');
	echo json_encode($arr);		 
	 }

	?>
